import request from "@/request/index.js";

const auth = "auth"; //http://101.42.107.47:30019文档
const base = "base"; //http://101.42.107.47:30020文档

//获取用户列表
export const getUserListApi = (params) => {
    return request({
        url: `/api/${base}/api/user/page`,
        method: "get",
        params,
    });
};

//新增用户
export const addNewUserApi = (data) => {
    return request({
        url: `/api/${base}/api/user`,
        method: "post",
        data,
    });
};

//重置密码
export const resetPasswordApi = (data) => {
    return request({
        url: `/api/${base}/api/user/reset/${data}`,
        method: "put",
    });
};

//删除用户
export const delUserApi = data => {
    return request({
        url: `/api/${base}/api/user/${data}`,
        method: "delete",
    });
}

//禁用启用
export const editUserValidApi = (params) => {
    return request({
        url: `/api/${base}/api/editUserValid`,
        method: "get",
        params,
    });
};

//批量禁用启用
export const editAllUserValidApi = (data) => {
    return request({
        url: `/api/${base}/api/batch`,
        method: "post",
        data,
    });
};

//用户信息修改
export const userInfoEditApi = (data) => {
    return request({
        url: `/api/${base}/api/user/edit`,
        method: "put",
        data
    });
};